package org.shopen.ai.puremvc.controller.settings
{
	import flash.events.Event;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.AsyncCommand;
	import org.shopen.ai.puremvc.model.settings.SettingsProxy;
	import org.shopen.ai.puremvc.model.utils.CompleteDelegate;
	import org.shopen.ai.puremvc.model.utils.ICompleteDelegate;

	public class LoadPerformModesCommand extends AsyncCommand
	{
		override public function execute(notification:INotification):void
		{
			var proxy : SettingsProxy = facade.retrieveProxy(SettingsProxy.NAME) as SettingsProxy;
			var delegate : ICompleteDelegate = new CompleteDelegate();
			delegate.addEventListener(CompleteDelegate.COMPLETE, completeListener);
			proxy.loadPerformModes(delegate, notification.getType());
		}
		
		private function completeListener(event : Event) : void
		{
			commandComplete();
		}
	}
}